<template>
    <el-menu :default-active="activeIndex" mode="horizontal" :ellipsis="false">

        <div class="flex-grow" />

        <el-sub-menu index="2">
            <template #title>
                <el-avatar :size="50">{{ baseStore.getAdmin.username }}</el-avatar>
            </template>
            <el-menu-item index="2-1" @click="baseStore.logout">
                <span >退出登录</span>
            </el-menu-item>
        </el-sub-menu>

    </el-menu>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
// @ts-ignore
import useBaseStore from '@/stores/baseStore.js'

const baseStore = useBaseStore()

const activeIndex = ref('1')
// const handleSelect = (key: string, keyPath: string[]) => {
//     console.log(key, keyPath)
// }
</script>

<style>
.flex-grow {
    flex-grow: 1;
}
</style>
